package controller

import (
	"context"
	"xr-game-server/core/httpserver"
	"xr-game-server/dto/roledto"
	"xr-game-server/module/role"
)

const (
	RoleUrl = "role"
)

type Role struct {
}

func initRole() {
	httpserver.RegAPI(RoleUrl, new(Role))
}

func (this *Role) GetAllRole(ctx context.Context, req *roledto.RoleReq) (res *roledto.RoleRes, err error) {
	return role.GetAllRole(ctx, req)
}

func (this *Role) CreateRoleName(ctx context.Context, req *roledto.CreateRoleReq) (res *string, err error) {
	return role.CreateRoleName(ctx, req)
}

func (this *Role) RoleEnterGame(ctx context.Context, req *roledto.RoleEnterGameReq) (res *roledto.RoleEnterGameRes, err error) {
	return role.EnterGame(ctx, req)
}
